#include<iostream>
using namespace std;
const int N = 1e5 + 10;
int arr[N];
int brr[N];
void insert(int x, int y, int c)
{
	brr[x] += c;
	brr[y + 1] -= c;
}
int main()
{
	int n, m;
	cin >> n >> m;
	for (int i = 0; i < n; i++) {
		int c;
		cin >> c;
		insert(i + 1, i + 1, c);
	}
	while (m--) {
		int x, y, c;
		cin >> x >> y >> c;
		insert(x, y, c);
	}
	for (int i = 1; i <= n; i++) {
		brr[i] += brr[i - 1];
	}
	for (int i = 1; i <= n; i++) {
		cout << brr[i] << " ";
	}
	return 0;
}